var pageSize = 7;

/**
 * 学校用户JS
 */
//分页每页显示数目
var pageSize = 7;

//模板绝对路径
var download_1_file_Path = "C:\\Users\\向奔\\Desktop\\Hwadee\\excel模板\\专业年级课程建设.xlsx";
var download_2_file_Path = "C:\\Users\\向奔\\Desktop\\Hwadee\\excel模板\\国际合作数据管理.xlsx";
var download_3_file_Path = "C:\\Users\\向奔\\Desktop\\Hwadee\\excel模板\\参与职教集团情况数据.xlsx";
var download_4_file_Path = "C:\\Users\\向奔\\Desktop\\Hwadee\\excel模板\\校企合作数据管理.xlsx";

var MajorGradeCourseConstruction_FilePath = "F:\\学习资料\\华迪实训\\正式阶段\\第三组tmp\\excel模板\\专业年级课程建设.xlsx";

$(document).ready(function () {
    $(this).keydown(function (e) {
        if (e.which == '13' && $('#search_input').is(':focus')) {
            loadSearchResult();
        }
    });
    // 初始化搜索框
    $('#search_input').typeahead({
        source:
            ['学校基本信息', '办学条件', '专业年级与课程建设', '国际合作', '参与职教集团情况', '校企合作', '全校实训基地统计图表',
                '专业大类实训基地统计图表', '公共实训基地统计图表', '公用实训基地人数统计图表', '公用实训基地耗材统计图表', '项目申报统计图表',
                '项目管理统计图表', '办学条件统计图表', '专业课程设计统计图表', '参与职教集团情况统计图表', '国际合作情况统计图表', '教师数据统计图表',
                '学生基本情况统计图表', '职业培训情况统计图表']
    });
});

// 载入学校情况
function loadSchoolInfor() {
    $('#content1').load('./school_infor.html');
    document.title = 'BEIS - 学校情况';
    // 菜单常亮
    $('#menu_1').attr("class", "active dropdown");
    $('#menu_2').attr("class", "dropdown");
    $('#menu_3').attr("class", "dropdown");
}

// 载入专业情况
function loadTeachPlanBasicSituation() {
    $('#content1').load('./teachplan_basic_situation.html');
    document.title = 'BEIS - 专业情况';
    // 菜单常亮
    $('#menu_1').attr("class", "active dropdown");
    $('#menu_2').attr("class", "dropdown");
    $('#menu_3').attr("class", "dropdown");
}

// 载入集训基地情况
function loadTrainBaseSituation() {
    $('#content1').load('./training_base_situation.html');
    document.title = 'BEIS - 专业情况';
    // 菜单常亮
    $('#menu_1').attr("class", "dropdown");
    $('#menu_2').attr("class", "active dropdown");
    $('#menu_3').attr("class", "dropdown");
}

// 载入职业培训情况
function loadVocationalTraining() {
    $('#content1').load('./vocational_training.html');
    document.title = 'BEIS - 专业情况';
    // 菜单常亮
    $('#menu_1').attr("class", "dropdown");
    $('#menu_2').attr("class", "active dropdown");
    $('#menu_3').attr("class", "dropdown");
}

function loadSchoolBasicInfor() {
    $('#content1').load('./school_basic_infor.html');
    document.title = 'BEIS - 基本情况';
    // 菜单常亮
    $('#menu_1').attr("class", "active dropdown");
    $('#menu_2').attr("class", "dropdown");
    $('#menu_3').attr("class", "dropdown");
}

//载入学生基础信息
function loadStudentBasicInfo() {
    $('#content1').load('./student_basic_situation.html');
    document.title = 'BEIS - 学生情况';
    // 菜单常亮
    $('#menu_1').attr("class", "active dropdown");
    $('#menu_2').attr("class", "dropdown");
    $('#menu_3').attr("class", "dropdown");
}

//载入公告界面
function loadMyNotice() {
    $('#content1').load('./my_notice.html');
    document.title = 'BEIS - 我的公告';
    // 菜单常亮
    $('#menu_1').attr("class", "dropdown");
    $('#menu_2').attr("class", "dropdown");
    $('#menu_3').attr("class", "active dropdown");
}

//载入搜索结果
function loadSearchResult() {
    $('#content1').load('./search_result.html');
    document.title = 'BEIS - 搜索结果';
    // 菜单常亮
    $('#menu_1').attr("class", "dropdown");
    $('#menu_2').attr("class", "dropdown");
    $('#menu_3').attr("class", "dropdown");

    // 显示查询结果
    var search_type = $('#search_type').val();
    var search_input = $('#search_input').val();
    if (search_type == '1') {
        // 基础数据
        if (search_input == "") {
            $('#alert-infor').text('查询输入为空');
            $('#alert-dialog').modal('show');
            setTimeout("$('#alert-dialog').modal('hide')", 2000);

        } else if ("学校基本信息".includes(search_input)) {
            // 查询学校基本信息
            $.ajax({
                type: 'GET',
                url: '/school/analysisdata/schoolbasicinfor',
                dataType: 'json',
                success: function (res) {
                    if (res.code == 200) {
                        var result_count = 1;
                        $('#result_count').text(result_count);

                        $('#notice_list').empty();
                        var search_result_html = "<div class='accordion-group'>" +
                            "<div class=''accordion-heading list' style='padding:1% 1% 1% 1%;text-align:left;'><div class='accordion-toggle collapsed' data-parent='#notice_list'	data-toggle='collapse' href='#pane_1'>" +
                            "<span style='width:50%;font-size:18px;'>" +
                            "<img class='img-circle' src='../img/psb.jpg' style='width:30px;height:30px;margin-right:1%'>" +
                            "<b id='search_result_school_name'>" + res.data.schoolName + "</b><br>基础数据-学校基本信息</span>" +
                            "<span style='font-size:18px;'><a style='float:right;'>查看更多▼</a></span></div></div>" +
                            "<div class='accordion-body collapse' id='pane_1'style='height: 0px;'>" +
                            "<div class='accordion-inner' id='search_detail'>" +
                            "<table cellpadding='3' class='table table-striped' style='width:100%;'>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>学校名称</td>" +
                            "<td style='width:50%;text-align:right;'>" + res.data.schoolName + "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>学校英文名称</td>" +
                            "<td style='width:50%;text-align:right;'>" + res.data.schoolEnglishname + "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>学校所属行政部门</td>" +
                            "<td style='width:50%;text-align:right;'>" + "" + "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>校长姓名</td>" +
                            "<td style='width:50%;text-align:right;'>" + res.data.principalName + "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>校长联系方式</td>" +
                            "<td style='width:50%;text-align:right;'>" + res.data.principalPhone + "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>学校驻地类型</td>" +
                            "<td style='width:50%;text-align:right;'>" + res.data.type + "</td></tr>" +
                            "</table></div></div></div>";

                        $('#notice_list').html(search_result_html);
                    } else {
                        alert(res.msg);
                        return;
                    }
                },
                error: function () {
                    alert('服务器异常');
                    return;
                }
            });

        } else if ("办学条件".includes(search_input)) {
            // 查询学校办学条件
            $.ajax({
                type: 'GET',
                url: '/school/analysisdata/schoolcondition',
                dataType: 'json',
                success: function (res) {
                    if (res.code == 200) {
                        var result_count = 1;
                        $('#result_count').text(result_count);

                        $('#notice_list').empty();
                        var html = "";
                        //alert(JSON.stringify(res.data));

                        html += "<div class='accordion-group'>" +
                            "<div class=''accordion-heading list' style='padding:1% 1% 1% 1%;text-align:left;'><div class='accordion-toggle collapsed' data-parent='#notice_list'	data-toggle='collapse' href='#pane_1'>" +
                            "<span style='width:50%;font-size:18px;'>" +
                            "<img class='img-circle' src='../img/psb.jpg' style='width:30px;height:30px;margin-right:1%'>" +
                            "<b id='search_result_school_name'>" + res.data.schoolBasic.schoolName + "</b><br>基础数据-办学条件</span>" +
                            "<span style='font-size:18px;'><a style='float:right;'>查看更多▼</a></span></div></div>" +
                            "<div class='accordion-body collapse' id='pane_1'style='height: 0px;'>" +
                            "<div class='accordion-inner' id='search_detail'>" +
                            "<table cellpadding='3' class='table table-striped' style='width:100%;'>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>学生用餐座位数</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.diningSeatCount != undefined) html += res.data.diningSeatCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>图书馆藏书数量</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.bookCount != undefined) html += res.data.bookCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>电子读物数量</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.electronicBookCount != undefined) html += res.data.electronicBookCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>报纸订阅数</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.newspaperSubscriptionCount != undefined) html += res.data.newspaperSubscriptionCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>期刊订阅数</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.journalSubscriptionCount != undefined) html += res.data.journalSubscriptionCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>阅览室座位数</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.readingroomSeatCount != undefined) html += res.data.readingroomSeatCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>电子阅览室座位数</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.electronicReadingroomSeatCount != undefined) html += res.data.electronicReadingroomSeatCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>教师用台式机数量</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.desktopCount != undefined) html += res.data.desktopCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>教师用笔记本数量</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.notebookCount != undefined) html += res.data.notebookCount;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>地方生均预算内拨款标准</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.localAverageBudgetaryAppropriation != undefined) html += res.data.localAverageBudgetaryAppropriation;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>地方财政专项拨款</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.localFinancialSpecialAllocation != undefined) html += res.data.localFinancialSpecialAllocation;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>负债总额</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.totalLiabilitie != undefined) html += res.data.totalLiabilitie;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>货款总额</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.totalPayment != undefined) html += res.data.totalPayment;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>教学仪器设备总值</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.educationalDeviceValue != undefined) html += res.data.educationalDeviceValue;
                        html += "</td></tr>" +
                            "<tr style='width:100%'><td style='width:50%;text-align:left;'>教学仪器设备总量</td>" +
                            "<td style='width:50%;text-align:right;'>";
                        if (res.data.educationalDeviceCount != undefined) html += res.data.educationalDeviceCount;
                        html += "</td></tr>" +
                            "</table></div></div></div>";
                        $('#notice_list').html(html);
                    } else {
                        alert(res.msg);
                        return;
                    }
                },
                error: function () {
                    alert('服务器异常');
                    return;
                }
            });

        } else if ("专业年级与课程建设".includes(search_input)) {
            // 查询学校专业年级与课程建设

        } else if ("国际合作".includes(search_input)) {
            // 查询学校国际合作

        } else if ("参与职教集团情况".includes(search_input)) {
            // 查询学校参与职教集团情况

        } else if ("校企合作".includes(search_input)) {
            // 查询学校校企合作

        } else {
            // 无结果

        }

    } else if (search_type == '2') {
        // 分析数据
        if (search_input == "") {
            $('#alert-infor').text('查询输入为空');
            $('#alert-dialog').modal('show');
            setTimeout("$('#alert-dialog').modal('hide')", 2000);
        } else if ("全校实训基地统计图表".includes(search_input)) {
            // 全校实训基地统计图表
            $.ajax({
                type: 'GET',
                url: '/school/analysisdata/wholeschooltrainingbase',
                dataType: 'json',
                success: function (res) {
                    if (res.code == 200) {
                        // 拉取数据成功
                        $('#result_count').text('1');
                        var html = "<div align='center' style='text-align:center;'>" +
                            "<div align='center' id='diagram' style='margin-top:1%;width:100%;height:500px;text-align:center;'></div></div>";
                        $('#notice_list').html(html);
                        var myChart = echarts.init(document.getElementById('diagram'));

                        var centralFund = new Array();  // 中央资金
                        var provinceFund = new Array();  // 省资金
                        var cityFund = new Array();  // 市资金
                        var countyFund = new Array();  // 区县资金
                        var selfFund = new Array();  // 自筹资金
                        var companyFund = new Array();  // 企业捐助资金
                        var modifyTime = new Array();

                        $.each(res.data, function (i, elt) {
                            var res_times = elt.modifyTime.toString().split("-");
                            var time = res_times[0].substr(2, 4) + "-" + res_times[1];

                            modifyTime.push(time);
                            var total = parseInt(elt.centralFund) + parseInt(elt.cityFund) + parseInt(elt.countryFund) + parseInt(elt.selfFund) + parseInt(elt.companyDonationFund);

                            centralFund.push((elt.centralFund / total * 100).toFixed(2));
                            cityFund.push((elt.cityFund / total * 100).toFixed(2));
                            countyFund.push((elt.countryFund / total * 100).toFixed(2));
                            selfFund.push((elt.selfFund / total * 100).toFixed(2));
                            companyFund.push((elt.companyDonationFund / total * 100).toFixed(2));


                        })

                        // 指定图表的配置项和数据
                        var option = {
                            // 标题
                            title: {
                                text: '全校实训基地资金投入占比情况',
                                subtext: '数据来源：成都市教育局中职基础教育能力平台'
                            },
                            // 鼠标交互
                            tooltip: {
                                trigger: 'axis'
                            },
                            //图例名
                            legend: {
                                data: ['中央资金', '省资金', '市资金', '区县资金', '自筹资金', '企业捐助资金'],
                                x: 300
                            },
                            grid: {
                                left: '3%', //图表距边框的距离
                                right: '4%',
                                bottom: '3%',
                                containLabel: true
                            },
                            //工具框，可以选择
                            toolbox: {
                                feature: {
                                    restore: {
                                        show: true,
                                        title: '还原'
                                    },
                                    dataView: {
                                        show: true,
                                        title: '数据视图',
                                        readOnly: true,
                                        lang: ['数据视图', '关闭', '刷新']
                                    },
                                    saveAsImage: {
                                        show: true,
                                        title: '保存图片'
                                    },
                                }
                            },
                            //x轴信息样式
                            xAxis: {
                                type: 'category',
                                boundaryGap: false,
                                data: modifyTime,
                                //坐标轴颜色
                                axisLine: {
                                    lineStyle: {
                                        color: '#EF7178'
                                    }
                                },
                                //x轴文字旋转
                                axisLabel: {
                                    rotate: 30,
                                    interval: 0
                                },
                            },

                            yAxis: [
                                {
                                    type: 'value',
                                    axisLabel: {
                                        formatter: '{value} %'
                                    }
                                }
                            ],
                            series: [
                                {
                                    name: '中央资金',
                                    type: 'line',
                                    symbol: 'circle', // 标志图形
                                    symbolSize: 4, //拐点圆的大小
                                    color: ['red'], //折线条的颜色
                                    data: centralFund,
                                    itemStyle: {
                                        normal: {
                                            lineStyle: {
                                                width: 2,
                                            }
                                        }
                                    }
                                },
                                {
                                    name: '省资金',
                                    type: 'line',
                                    symbol: 'circle', // 标志图形
                                    symbolSize: 4, //拐点圆的大小
                                    color: ['blue'], //折线条的颜色
                                    data: provinceFund,
                                    itemStyle: {
                                        normal: {
                                            lineStyle: {
                                                width: 2,
                                            }
                                        }
                                    }
                                },
                                {
                                    name: '市资金',
                                    type: 'line',
                                    symbol: 'circle', // 标志图形
                                    symbolSize: 4, //拐点圆的大小
                                    color: ['orange'], //折线条的颜色
                                    data: cityFund,
                                    itemStyle: {
                                        normal: {
                                            lineStyle: {
                                                width: 2,
                                            }
                                        }
                                    }
                                },
                                {
                                    name: '区县资金',
                                    type: 'line',
                                    symbol: 'circle', // 标志图形
                                    symbolSize: 4, //拐点圆的大小
                                    color: ['green'], //折线条的颜色
                                    data: countyFund,
                                    itemStyle: {
                                        normal: {
                                            lineStyle: {
                                                width: 2,
                                            }
                                        }
                                    }
                                },
                                {
                                    name: '自筹资金',
                                    type: 'line',
                                    symbol: 'circle', // 标志图形
                                    symbolSize: 4, //拐点圆的大小
                                    color: ['grey'], //折线条的颜色
                                    data: selfFund,
                                    itemStyle: {
                                        normal: {
                                            lineStyle: {
                                                width: 2,
                                            }
                                        }
                                    }
                                },
                                {
                                    name: '企业捐助资金',
                                    type: 'line',
                                    symbol: 'circle', // 标志图形
                                    symbolSize: 4, //拐点圆的大小
                                    color: ['pink'], //折线条的颜色
                                    data: companyFund,
                                    itemStyle: {
                                        normal: {
                                            lineStyle: {
                                                width: 2,
                                            }
                                        }
                                    }
                                },

                            ]
                        };

                        // 使用刚指定的配置项和数据显示图表。
                        myChart.setOption(option);
                    } else {
                        alert(res.msg);
                        return;
                    }
                },
                error: function () {
                    alert('服务器异常');
                    return;
                }
            });

        } else if ("专业大类实训基地统计图表".includes(search_input)) {
            // 专业大类实训基地统计同表

        } else if ("公共实训基地统计图表".includes(search_input)) {
            // 公共实训基地统计图表

        } else if ("公用实训基地人数统计图表".includes(search_input)) {
            // 公用实训基地人数统计图表
            $.ajax({
                type: 'GET',
                url: '/school/analysisdata/publictrainingbase',
                dataType: 'json',
                success: function (res) {
                    if (res.code == 200) {
                        // 拉取数据成功
                        $('#result_count').text('1');
                        var html = "<div align='center' style='text-align:center;'>" +
                            "<div align='center' id='diagram' style='margin-top:1%;width:100%;height:500px;text-align:center;'></div></div>";
                        $('#notice_list').html(html);
                        var myChart = echarts.init(document.getElementById('diagram'));

                        // 指定图表的配置项和数据
                        var option = {
                            // 标题
                            title: {
                                text: '公用实训基地人数统计图表',
                                subtext: '数据来源：成都市教育局中职基础教育能力平台',
                                x: 'center'
                            },
                            // 鼠标交互
                            tooltip: {
                                trigger: 'item',
                                formatter: "{a} <br/>{b} : {c} ({d}%)"
                            },
                            //图例名
                            legend: {
                                orient: 'vertical',
                                left: 'left',
                                data: ['社会化培训', '外来学校学生', '本校学生']
                            },
                            grid: {
                                left: '3%', //图表距边框的距离
                                right: '4%',
                                bottom: '3%',
                                containLabel: true
                            },
                            //工具框，可以选择
                            toolbox: {
                                feature: {
                                    restore: {
                                        show: true,
                                        title: '还原'
                                    },
                                    dataView: {
                                        show: true,
                                        title: '数据视图',
                                        readOnly: true,
                                        lang: ['数据视图', '关闭', '刷新']
                                    },
                                    saveAsImage: {
                                        show: true,
                                        title: '保存图片'
                                    },
                                }
                            },
                            series: [
                                {
                                    name: '实训人数',
                                    type: 'pie',
                                    radius: '55%',
                                    center: ['50%', '60%'],
                                    data: [
                                        {value: parseInt(res.data.receiveSocializationPersonCount), name: '社会化培训'},
                                        {value: parseInt(res.data.receiveOutsideSchoolStudentCount), name: '外来学校学生'},
                                        {value: parseInt(res.data.receiveInsideSchoolStudentCount), name: '本校学生'}],
                                    itemStyle: {
                                        emphasis: {
                                            shadowBlur: 10,
                                            shadowOffsetX: 0,
                                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                                        }
                                    }
                                }

                            ]
                        };

                        // 使用刚指定的配置项和数据显示图表。
                        myChart.setOption(option);
                    } else {
                        alert(res.msg);
                        return;
                    }
                },
                error: function () {
                    alert('服务器异常');
                    return;
                }
            });

        } else if ("公用实训基地耗材统计图表".includes(search_input)) {
            // 公用实训基地耗材统计图表
            $.ajax({
                type: 'GET',
                url: '/school/analysisdata/publictrainingbase',
                dataType: 'json',
                success: function (res) {
                    if (res.code == 200) {
                        // 拉取数据成功
                        $('#result_count').text('1');
                        var html = "<div align='center' style='text-align:center;'>" +
                            "<div align='center' id='diagram' style='margin-top:1%;width:100%;height:500px;text-align:center;'></div></div>";
                        $('#notice_list').html(html);
                        var myChart = echarts.init(document.getElementById('diagram'));

                        // 指定图表的配置项和数据
                        var option = {
                            // 标题
                            title: {
                                text: '公用实训基地耗材统计图表',
                                subtext: '数据来源：成都市教育局中职基础教育能力平台',
                                x: 'center'
                            },
                            // 鼠标交互
                            tooltip: {
                                trigger: 'item',
                                formatter: "{a} <br/>{b} : {c} ({d}%)"
                            },
                            //图例名
                            legend: {
                                orient: 'vertical',
                                left: 'left',
                                data: ['填报', '社会化培训', '外来学校学生', '本校学生']
                            },
                            grid: {
                                left: '3%', //图表距边框的距离
                                right: '4%',
                                bottom: '3%',
                                containLabel: true
                            },
                            //工具框，可以选择
                            toolbox: {
                                feature: {
                                    restore: {
                                        show: true,
                                        title: '还原'
                                    },
                                    dataView: {
                                        show: true,
                                        title: '数据视图',
                                        readOnly: true,
                                        lang: ['数据视图', '关闭', '刷新']
                                    },
                                    saveAsImage: {
                                        show: true,
                                        title: '保存图片'
                                    },
                                }
                            },
                            series: [
                                {
                                    name: '耗材金额',
                                    type: 'pie',
                                    radius: '55%',
                                    center: ['50%', '60%'],
                                    data: [
                                        {value: parseFloat(res.data.consumablesMoney), name: '填报'},
                                        {
                                            value: parseFloat(res.data.receiveSocializationConsumablesMoney),
                                            name: '社会化培训'
                                        },
                                        {
                                            value: parseFloat(res.data.receiveOutsideSchoolConsumalbesMoney),
                                            name: '外来学校学生'
                                        },
                                        {
                                            value: parseFloat(res.data.receiveInsideSchoolConsumablesMoney),
                                            name: '本校学生'
                                        }],
                                    itemStyle: {
                                        emphasis: {
                                            shadowBlur: 10,
                                            shadowOffsetX: 0,
                                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                                        }
                                    }
                                }
                            ]
                        };

                        // 使用刚指定的配置项和数据显示图表。
                        myChart.setOption(option);
                    } else {
                        alert(res.msg);
                        return;
                    }
                },
                error: function () {
                    alert('服务器异常');
                    return;
                }
            });

        } else if ("项目申报统计图表".includes(search_input)) {
            // 项目申报统计图表

        } else if ("项目管理统计图表".includes(search_input)) {
            // 项目管理统计图表

        } else if ("办学条件统计图表".includes(search_input)) {
            // 办学条件统计图表

        } else if ("专业课程设计统计图表".includes(search_input)) {
            // 专业课程设计统计图表

        } else if ("参与职教集团情况统计图表".includes(search_input)) {
            // 参与职教集团情况统计图表

        } else if ("国际合作情况统计图表".includes(search_input)) {
            // 国际合作情况统计图表

        } else if ("教师数据统计图表".includes(search_input)) {
            // 教师数据统计图表

        } else if ("学生基本情况统计图表".includes(search_input)) {
            // 学生基本情况统计图表
            $.ajax({
                type: 'GET',
                url: '/school/analysisdata/studentbasicsituation',
                dataType: 'json',
                success: function (res) {
                    if (res.code == 200) {
                        // 拉取数据成功
                        $('#result_count').text('1');
                        var html = "<div align='center' style='text-align:center;'>" +
                            "<div align='center' id='diagram' style='margin-top:1%;width:100%;height:500px;text-align:center;'></div></div>";
                        $('#notice_list').html(html);
                        var myChart = echarts.init(document.getElementById('diagram'));

                        var studentCount = new Array();
                        var loseStudentCount = new Array();
                        var modifyTime = new Array();

                        $.each(res.data, function (i, elt) {
                            var res_times = elt.modifyTime.toString().split("-");
                            var time = res_times[0].substr(2, 4) + "-" + res_times[1];

                            var isIncluded = $.inArray(time, modifyTime);
                            if (isIncluded == -1) {
                                modifyTime.push(time);
                                studentCount.push(elt.studentCount);
                                loseStudentCount.push(elt.loseStudentCount);
                            }


                        })

                        // 指定图表的配置项和数据
                        var option = {
                            // 标题
                            title: {
                                text: '学生基本情况',
                                subtext: '数据来源：成都市教育局中职基础教育能力平台'
                            },
                            // 鼠标交互
                            tooltip: {
                                trigger: 'axis'
                            },
                            //图例名
                            legend: {
                                data: ['学生人数', '流失学生人数']
                            },
                            grid: {
                                left: '3%', //图表距边框的距离
                                right: '4%',
                                bottom: '3%',
                                containLabel: true
                            },
                            //工具框，可以选择
                            toolbox: {
                                feature: {
                                    restore: {
                                        show: true,
                                        title: '还原'
                                    },
                                    dataView: {
                                        show: true,
                                        title: '数据视图',
                                        readOnly: true,
                                        lang: ['数据视图', '关闭', '刷新']
                                    },
                                    saveAsImage: {
                                        show: true,
                                        title: '保存图片'
                                    },
                                }
                            },
                            //x轴信息样式
                            xAxis: {
                                type: 'category',
                                boundaryGap: false,
                                data: modifyTime,
                                //坐标轴颜色
                                axisLine: {
                                    lineStyle: {
                                        color: '#EF7178'
                                    }
                                },
                                //x轴文字旋转
                                axisLabel: {
                                    rotate: 30,
                                    interval: 0
                                },
                            },

                            yAxis: [
                                {
                                    type: 'value',
                                    axisLabel: {
                                        formatter: '{value} 人'
                                    }
                                }
                            ],
                            series: [
                                {
                                    name: '学生人数',
                                    type: 'line',
                                    symbol: 'circle', // 标志图形
                                    symbolSize: 4, //拐点圆的大小
                                    color: ['blue'], //折线条的颜色
                                    data: studentCount,
                                    itemStyle: {
                                        normal: {
                                            lineStyle: {
                                                width: 2,
                                            }
                                        }
                                    }
                                },
                                {
                                    name: '流失学生人数',
                                    type: 'line',
                                    symbolSize: 4,
                                    smooth: false,
                                    itemStyle: {
                                        normal: {
                                            lineStyle: {
                                                type: 'dotted', //'dotted'虚线 'solid'实线
                                                color: 'red',
                                                borderColor: 'red' //拐点边框颜色
                                            }
                                        }
                                    },
                                    data: loseStudentCount
                                }
                            ]
                        };

                        // 使用刚指定的配置项和数据显示图表。
                        myChart.setOption(option);
                    } else {
                        alert(res.msg);
                        return;
                    }
                },
                error: function () {
                    alert('服务器异常');
                    return;
                }
            });
        } else if ("职业培训情况统计图表".includes(search_input)) {
            // 职业培训情况统计图表

        }

    } else if (search_type == '3') {
        // 项目数据

    } else {
        // 查询类型错误
        alert('错误的查询类型');
        return;
    }
}

//载入教师情况填报
function loadTeacherSituation() {
    $('#content1').load('./teacher_situation.html');
    document.title = 'BEIS - 教师信息';
    //菜单常亮
    $('#menu_1').attr("class", "active dropdown");
    $('#menu_2').attr("class", "dropdown");
    $('#menu_3').attr("class", "dropdown");
}

function loadProjectDeclare() {
    $('#content1').load('./project_declare.html');
    document.title = 'BEIS - 专项资金项目';
    // 菜单常亮
    $('#menu_1').attr("class", "dropdown");
    $('#menu_2').attr("class", "active dropdown");
    $('#menu_3').attr("class", "dropdown");
}

// 填写数据表单输入框失焦事件
function inputOnBlur(ele) {
    var reg = /^[1-9]\d*$|^0$/;
    var input = $(ele);
    var div = input.parent().parent(); // input的div容器，获取它，并修改边框样式
    if (input.val() == "") {
        div.attr("class", "null-list");
    } else if (input.attr('type') == "number" || reg.test(input.val()) == true) {
        div.attr("class", "correct-list");
    } else if (input.attr("type") == "file") {
        div.attr("class", "correct-list");
    } else if (input.attr('type') == "text") {
        div.attr("class", "correct-list");
    } else {
        div.attr("class", "wrong-list");
    }
}

function inputJudge(ele) {

}

// 选择文件按钮
function chooseFile(ele) {
    // 触发文件选择按钮
    $(ele).next().click();
}

// 显示文件路径
function selectFile(ele) {
    $(ele).prev().prev().text("当前文件：" + ($(ele).val().split('\\')[2]));
    $(ele).parent().parent().attr("class", "correct-list");
}

// 注销账户
function logout() {
    $.ajax({
        type: 'GET',
        url: '/management/logout',
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                $('#alert-infor').text('注销成功');
                $('#alert-dialog').modal('show');
                setTimeout("$('#alert-dialog').modal('hide')", 1000);
                window.location.href = "/html/login.html";
            } else {
                alert(res.msg);
            }
        },
        error: function () {
            alert('服务器异常');
        }
    });
}

// 选择切换框按钮改变CSS
function select(ele) {
    var li = $(ele).parent();
    //	alert(li.val());
    li.attr("class", "active");
    $(ele).css("color", "#EF7178");
    $(ele).css("border-bottom-color", "#EF7178");
    var other_li = li.siblings('li');
    other_li.each(function (i, element) {
        $(this).removeClass("active");
        $(this).children().eq(0).css("color", "grey");
        $(this).children().eq(0).css("border-bottom-color", "");
    });
    var school_basic_input = $(ele).attr("data-school-basic-input");
    var panel_id = "";
    switch (school_basic_input) {
        case "1" :
            panel_id += "panel-1";
            break;
        case "2" :
            panel_id += "panel-2";
            break;
        case "3" :
            panel_id += "panel-3";
            break;
        case "4" :
            panel_id += "panel-4";
            break;
        case "5" :
            panel_id += "panel-5";
            break;
        default :
            break;
    }
    if ("" != panel_id) {
        $("#" + panel_id).attr("class", "tab-pane active");
        $.each($("#" + panel_id).siblings(), function (i, elt) {
            $(elt).attr('class', 'tab-pane');
        })
    }
}

function selectTab(ele, n) {
    var li = $(ele).parent();
    $(ele).css("color", "#EF7178");
    $(ele).css("border-bottom-color", "#EF7178");
    var other_li = li.siblings('li');
    other_li.each(function (i, element) {
        $(this).removeClass("active");
        $(this).children().eq(0).css("color", "grey");
        $(this).children().eq(0).css("border-bottom-color", "");
    })
    $('#tablist-1 li:eq(n) a').tab('show');
}

/**
 * 增加教师基础信息
 */
function addTeacherBasic() {
    $.ajax({
        type: 'PUT',
        url: '/school/Teacher/BasicSituation',
        data: {
            servicingStaffCount: $("#servicing_staff_count").val(),
            facultyStaffCount: $("#faculty_staff_count").val(),
            regularTeacherCount: $("#regular_teacher_count").val(),
            foreignTeacherCount: $("#foreign_teacher_count").val(),
            counselingTeacherCount: $("#counseling_teacher_count").val(),
            maleTeacherCount: $("#male_teacher_count").val(),
            femaleTeacherCount: $("#female_teacher_count").val(),
            cultureTeacherCount: $("#culture_teacher_count").val(),
            majorTeacherCount: $("#major_teacher_count").val(),
            mainHighTeacherCount: $("#mainHigh_teacher_count").val(),
            deputyHighTeacherCount: $("#deputyHigh_teacher_count").val(),
            intermediateTeacherCount: $("#intermediate_teacher_count").val(),
            primaryTeacherCount: $("#primary_teacher_count").val(),
            rookieTeacherCount: $("#rookie_teacher_count").val(),
            professionalSubjectLeaderCount: $("#professional_subject_leader_count").val(),
            cityOutstandYoungTeacherCount: $("#city_outstand_young_teacher_count").val(),
            citySpecialTeacherCount: $("#city_special_teacher_count").val(),
            provincialSpecialTeacherCount: $("#provincial_special_teacher_count").val(),
            doubleTypeTeacherCount: $("#doubleType_teacher_count").val(),
        },
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                alert("填报成功！");
                initTeacherPage(1);
            }
            else
                alert(res.msg);
        },
        error: function () {
            alert("填报失败，服务器错误。");
            initTeacherPage(1);
        }
    });
}

/**
 * 拉取教师基础信息
 */
function loadTeacherBasic(pageIndex) {
    var pageNum = pageIndex;
    $.ajax({
        type: 'POST',
        url: '/school/Teacher/BasicSituation',
        data: {
            size: pageSize,
            page: pageNum
        },
        dataType: 'json',
        success: function (res) {
            $.each(res.data.content, function (index, obj) {
                $("#situation_list_basic").append("<tr>" +
                    "<td style=\"text-align: center;\">" + obj['teacherBasicSituationId'] + "</td>" +
                    "<td style=\"text-align: center;\">" + obj['modifyTime'] + "</td>" +
                    "<td style=\"text-align: center;\">" + ConvertAuditStausToString(obj['countyAuditStatus']) + "</td>" +
                    "<td style=\"text-align: center;\">" + ConvertAuditStausToString(obj['cityAuditStatus']) + "</td>" +
                    "</tr>"
                );
                $('#pagination_basic').jqPaginator('option', {
                    totalCounts: res.data.totalElements
                });
            });
        }
    });
}

function ConvertAuditStausToString(status) {
    if (status == "0")
        return "审核未通过";
    else
        return "审核通过";
}

/*
function download() {
    window.location.href="http://127.0.0.1:8080/school/download";
}*/

/**
 * 填写办学条件
 */
function submitSchoolCondition() {
    var diningSeatCount = $('#diningSeatCount').val();
    var bookCount = $('#bookCount').val();
    var electronicBookCount = $('#electronicBookCount').val();
    var newspaperSubscriptionCount = $('#newspaperSubscriptionCount').val();
    var journalSubscriptionCount = $('#journalSubscriptionCount').val();
    var readingroomSeatCount = $('#readingroomSeatCount').val();
    var electronicReadingroomSeatCount = $('#electronicReadingroomSeatCount').val();
    var desktopCount = $('#desktopCount').val();
    var notebookCount = $('#notebookCount').val();


    var totalLiabilitie = $('#totalLiabilitie').val();
    var totalPayment = $('#totalPayment').val();
    var educationalDeviceValue = $('#educationalDeviceValue').val();
    var educationalDeviceCount = $('#educationalDeviceCount').val();

    // 打包data
    var data = new FormData();
    if ($('#localAverageBudgetaryAppropriation_file').val() != "") {
        var localAverageBudgetaryAppropriation_file = $('#localAverageBudgetaryAppropriation_file')[0].files[0];
        data.append("localAverageBudgetaryAppropriation_file", localAverageBudgetaryAppropriation_file);
    }
    if ($('#localFinancialSpecialAllocation_file').val() != "") {
        var localFinancialSpecialAllocation_file = $('#localFinancialSpecialAllocation_file')[0].files[0];
        data.append("localFinancialSpecialAllocation_file", localFinancialSpecialAllocation_file);
    }
    data.append("diningSeatCount", diningSeatCount);
    data.append("bookCount", bookCount);
    data.append("electronicBookCount", electronicBookCount);
    data.append("newspaperSubscriptionCount", newspaperSubscriptionCount);
    data.append("journalSubscriptionCount", journalSubscriptionCount);
    data.append("readingroomSeatCount", readingroomSeatCount);
    data.append("electronicReadingroomSeatCount", electronicReadingroomSeatCount);
    data.append("desktopCount", desktopCount);
    data.append("notebookCount", notebookCount);


    data.append("totalLiabilitie", totalLiabilitie);
    data.append("totalPayment", totalPayment);
    data.append("educationalDeviceValue", educationalDeviceValue);
    data.append("educationalDeviceCount", educationalDeviceCount);

    $.ajax({
        type: 'POST',
        url: '/school/schoolcondition',
        data: data,
        cache: false, // 上传文件无需缓存
        processData: false, // 用于对data参数进行序列化处理 这里必须false
        contentType: false, // 必须
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                // 提交成功
                alert('success');
            } else {
                alert(res.msg);
                return;
            }
        },
        error: function () {
            alert('服务器异常');
            return;
        }
    });
}

//填写专业课程建设信息
function submitMajorGradeCourseConstruction() {
    //打包data
    var data = new FormData();
    if ($('#majorgradecourseconstruction_file').val() != "") {
        var majorgradecourseconstruction_file = $('#majorgradecourseconstruction_file')[0].files[0];
        data.append("majorgradecourseconstruction_file", majorgradecourseconstruction_file);
    }
    $.ajax({
        type: 'POST',
        url: '/school/majorgradecourseconstruction',
        data: data,
        cache: false, // 上传文件无需缓存
        processData: false, // 用于对data参数进行序列化处理 这里必须false
        contentType: false, // 必须
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                // 提交成功
                alert('success');
            } else {
                alert(res.msg);
                return;
            }
        },
        error: function () {
            alert('服务器异常');
            return;
        }
    });

}

//填写国际合作信息
function submitGlobalCooperation() {
    //打包data
    var data = new FormData();
    if ($('#globalcooperation_file').val() != "") {
        var globalcooperation_file = $('#globalcooperation_file')[0].files[0];
        data.append("globalcooperation_file", globalcooperation_file);
    }
    $.ajax({
        type: 'POST',
        url: '/school/globalcooperation',
        data: data,
        cache: false, // 上传文件无需缓存
        processData: false, // 用于对data参数进行序列化处理 这里必须false
        contentType: false, // 必须
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                // 提交成功
                alert('success');
            } else {
                alert(res.msg);
                return;
            }
        },
        error: function () {
            alert('服务器异常');
            return;
        }
    });

}

//填写参与职教集团信息
function submitVocationalEducationGroup() {
    //打包data
    var data = new FormData();
    if ($('#vocationaleducationgroup_file').val() != "") {
        var vocationaleducationgroup_file = $('#vocationaleducationgroup_file')[0].files[0];
        data.append("vocationaleducationgroup_file", vocationaleducationgroup_file);
    }
    $.ajax({
        type: 'POST',
        url: '/school/vocationaleducationgroup',
        data: data,
        cache: false, // 上传文件无需缓存
        processData: false, // 用于对data参数进行序列化处理 这里必须false
        contentType: false, // 必须
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                // 提交成功
                alert('success');
            } else {
                alert(res.msg);
                return;
            }
        },
        error: function () {
            alert('服务器异常');
            return;
        }
    });

}

//填写校企合作信息
function submitSchoolCompanyCooperation() {
    //打包data
    var data = new FormData();
    if ($('#schoolcompanycooperation_file').val() != "") {
        var schoolcompanycooperation_file = $('#schoolcompanycooperation_file')[0].files[0];
        data.append("schoolcompanycooperation_file", schoolcompanycooperation_file);
    }
    $.ajax({
        type: 'POST',
        url: '/school/schoolcompanycooperation',
        data: data,
        cache: false, // 上传文件无需缓存
        processData: false, // 用于对data参数进行序列化处理 这里必须false
        contentType: false, // 必须
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                // 提交成功
                alert('success');
            } else {
                alert(res.msg);
                return;
            }
        },
        error: function () {
            alert('服务器异常');
            return;
        }
    });

}

function initTeacherPage(totalCounts) {
    $('#pagination_basic').jqPaginator({
        totalCounts: totalCounts, // 总记录数
        pageSize: pageSize, // 每页显示记录数
        visiblePages: 10, // 显示页按钮数
        currentPage: 1, // 当前页码
        wrapper: "<ul></ul>",
        first: '<li class="first"><a href="javascript:void(0);">首页</a></li>',
        prev: '<li class="prev"><a href="javascript:void(0);">上一页</a></li>',
        next: '<li class="next"><a href="javascript:void(0);">下一页</a></li>',
        last: '<li class="last"><a href="javascript:void(0);">末页</a></li>',
        page: '<li class="page"><a href="javascript:void(0);">{{page}}</a></li>',
        onPageChange: function (index, type) {
            $("#situation_list_basic tr:not(:first)").empty("");
            loadTeacherBasic(index - 1);
        }
    });
}

/**
 * 初始化公告分页
 * @param totalCounts
 */
function initNoticePage(totalCounts) {
    $('#pagination').jqPaginator({
        totalCounts: totalCounts, // 总记录数
        pageSize: pageSize, // 每页显示记录数
        visiblePages: 10, // 显示页按钮数
        currentPage: 1, // 当前页码
        wrapper: "<ul></ul>",
        first: '<li class="first"><a href="javascript:void(0);">首页</a></li>',
        prev: '<li class="prev"><a href="javascript:void(0);">上一页</a></li>',
        next: '<li class="next"><a href="javascript:void(0);">下一页</a></li>',
        last: '<li class="last"><a href="javascript:void(0);">末页</a></li>',
        page: '<li class="page"><a href="javascript:void(0);">{{page}}</a></li>',
        onPageChange: function (page_index, type) {
            getNotice(page_index - 1);
        }
    });
}

/**
 * 拉取公告数据
 * @param page
 */
function getNotice(page) {
    $.ajax({
        type: 'POST',
        url: '/management/announcement/school',
        data: {
            page: page,
            size: pageSize,
            sort: ['publishTime', 'desc']
        },
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                // 拉取公告成功
                var html = "";
                $.each(res.data.content, function (index, elt) {
                    html += "<div class=\"accordion-group\">\n" +
                        "                <div class=\"accordion-heading list\"\n" +
                        "                     style=\"border-style:solid solid solid solid;padding:1% 1% 1% 1%;\">\n" +
                        "                    <div class=\"accordion-toggle collapsed\" data-parent=\"#notice_list\"\n" +
                        "                         data-toggle=\"collapse\" href=\"#pane_" + index + "\">\n" +
                        "<span style=\"width:50%;font-size:18px;\"><img\n" +
                        "                                class=\"img-circle\" src=\"../img/psb.jpg\" style=\"width:30px;height:30px;\"><b>" + elt.cityUser.cityEdbName + "</b><br>公告类型：" + elt.announcementType + "</span><span\n" +
                        "                            style=\"font-size:18px;\"><a style=\"float:right;margin-left:1%;\">查看更多▼</a><span id='modify_time' style='float:right;'>" + elt.publishTime + "</span></span>\n" +
                        "                    </div>\n" +
                        "                </div>\n" +
                        "                <div class=\"accordion-body collapse\" id=\"pane_" + index + "\"\n" +
                        "                     style=\"height: 0px;\">\n" +
                        "                    <div class=\"accordion-inner\">" + elt.announcementInfor + "</div>\n" +
                        "                </div>\n" +
                        "            </div>\n";
                });
                $('#notice_list').html(html);
                $('#pagination').jqPaginator('option', {
                    totalCounts: res.data.totalElements
                });
            } else {
                alert(res.msg);
                return;
            }
        },
        error: function () {
            alert('服务器异常');
            return;
        }
    });
}

/**
 * 提交专业课程建设文件
 */
function submitMajorGradeCourseConstructionFile() {
    if ($('#MGCC_file')[0].files[0] != undefined) {
        var data = new FormData();
        data.append('multipartFile', $('#MGCC_file')[0].files[0]);

        $.ajax({
            type: 'POST',
            url: '/school/majorgradecourseconstruction',
            data: data,
            cache: false, // 上传文件无需缓存
            processData: false, // 用于对data参数进行序列化处理 这里必须false
            contentType: false, // 必须
            dataType: 'json',
            success: function (res) {
                if (res.code == 200) {
                    alert(res.msg);
                } else {
                    alert(res.msg);
                    return;
                }
            },
            error: function () {
                alert('服务器异常');
                return;
            }
        })
    }
}
function addSchoolBasic() {
    var type
    switch ($('#schoolSelectTitle').text()){
        case "主城区":
            type = 1;
            break;
        case "城乡结合区":
            type = 2;
            break;
        case "镇中心区":
            type = 3;
            break;
        case "乡镇结合区":
            type = 4;
            break;
        case "城乡类型":
            type = null;
            break;
    }
    $.ajax({
        type: 'PUT',
        url: '/school/basicinfor',
        data: {
            schoolName:$("#schoolName").val(),
            schoolEnglishname:$("#schoolEnglishname").val(),
            schoolAddress:$("#schoolAddress").val(),
            principalName:$("#principalName").val(),
            principalPhone:$("#principalPhone").val(),
            type:type
        },
        dataType: 'json',
        success: function (res) {
            if (res.code == 200) {
                alert("填报成功！");
            }
            else
                alert(res.msg);
        },
        error: function () {
            alert("填报失败，服务器错误。");
        }
    });
}
/**
 *
 */
function loadSchoolTypeSelect() {
    var tempText
    if ($('#schoolSelectTitle').text() == "城乡类型" || $('#schoolSelectTitle').text() == "主城区" || $('#schoolSelectTitle').text() == "城乡结合区"
        || $('#schoolSelectTitle').text() == "镇中心区" || $('#schoolSelectTitle').text() == "乡镇结合区") {
        tempText = $('#schoolSelectTitle').text();
        $('#schoolSelectTitle').text(tempText + " ");
        $('#schoolSelectDrop').height(function (index, currentHeight) {
            return currentHeight + 120;
        });
    } else {
        tempText = $('#schoolSelectTitle').text();
        $('#schoolSelectTitle').text(tempText.replace(" ", ""));
        $('#schoolSelectDrop').height(function (index, currentHeight) {
            return currentHeight - 120;
        });
    }
}

function schoolTypeSelect(selection) {
    $('#schoolSelectDrop').height(function (index, currentHeight) {
        return currentHeight - 120;
    });
    switch (selection) {
        case 0:
            $('#schoolSelectTitle').text("主城区");
            break;
        case 1:
            $('#schoolSelectTitle').text("城乡结合区");
            break;
        case 2:
            $('#schoolSelectTitle').text("镇中心区");
            break;
        case 3:
            $('#schoolSelectTitle').text("乡镇结合区");
            break;
    }
}

/**
 * 加载项目申报模板选择框
 */
function loadProjectSelect() {
    var tempText
    if ($('#selectTitle').text() == "项目类型" || $('#selectTitle').text() == "中央资金支持的项目" || $('#selectTitle').text() == "省级资金支持的项目"
        || $('#selectTitle').text() == "市级资金支持的项目" || $('#selectTitle').text() == "民办资金支持的项目" || $('#selectTitle').text() == "其他项目") {
        tempText = $('#selectTitle').text();
        $('#selectTitle').text(tempText + " ");
        $('#projectSelectDropDown').height(function (index, currentHeight) {
            return currentHeight + 150;
        });
    } else {
        tempText = $('#selectTitle').text();
        $('#selectTitle').text(tempText.replace(" ", ""));
        $('#projectSelectDropDown').height(function (index, currentHeight) {
            return currentHeight - 150;
        });
    }
}

function projectTempletSelect(selection) {
    $('#projectSelectDropDown').height(function (index, currentHeight) {
        return currentHeight - 150;
    });
    switch (selection) {
        case 0:
            $('#selectTitle').text("中央资金支持的项目");
            break;
        case 1:
            $('#selectTitle').text("省级资金支持的项目");
            break;
        case 2:
            $('#selectTitle').text("市级资金支持的项目");
            break;
        case 3:
            $('#selectTitle').text("民办资金支持的项目");
            break;
        case 4:
            $('#selectTitle').text("其他项目");
            break;
    }
}

function addProjectDeclare() {
    if ($('#project_declare_file').val() != "") {
        var data = new FormData();
        data.append('multipartFile', $('#project_declare_file')[0].files[0]);
        data.append('projectName', $('#projectName').val());
        data.append('projectManager', $('#projectManager').val());
        data.append('projectDescription', $('#projectDescription').val());

        $.ajax({
            type: 'PUT',
            url: '/school/ProjectDeclare',
            data: data,
            cache: false, // 上传文件无需缓存
            processData: false, // 用于对data参数进行序列化处理 这里必须false
            contentType: false, // 必须
            dataType: 'json',
            success: function (res) {
                if (res.code == 200) {
                    alert(res.msg);
                } else {
                    alert(res.msg);
                    return;
                }
            },
            error: function () {
                alert('服务器异常');
                return;
            }
        })
    }
}